
#include "error_report.h"
#include "errors_warnings.h"

#include "main_container.h"
extern MainContainer * CompilerData;


ErrorReport::ErrorReport()
{
	predefinedErrors = new GenericTable<ErrorEntry>();
	predefinedWarnings = new GenericTable<WarningEntry>();
}


ErrorReport::~ErrorReport()
{
	if(predefinedErrors != NULL)
	{
		delete predefinedErrors;
		predefinedErrors = NULL;
	}

	if(predefinedWarnings != NULL)
	{
		delete predefinedWarnings;
		predefinedWarnings = NULL;
	}

}



void ErrorReport::ReportError(LexicUnit * lu, unsigned long errorID)
{
#ifdef TRACE
	CompilerData->LogTrace->ReportEntry("ReportError");
#endif

#ifdef TRACE
	CompilerData->LogTrace->ReportLine("TODO");
#endif
	ErrorEntry * ee = NULL;
	for(int i = 0; i < this->predefinedErrors->GetCount(); i++)
	{
		ErrorEntry * eeTest = this->predefinedErrors->GetData(i);
 		if(eeTest->id == errorID)
		{
			ee = eeTest;
			break;
		}
	}
	printf("File %d [%d, %d]: error 0x%X - %s\n", lu->sourceFileId, lu->sourceLineId, lu->sourceColumnId, errorID, ee != NULL ? ee->str : "?????");


#ifdef TRACE
	CompilerData->LogTrace->ReportExit("ReportError");
#endif
}




void ErrorReport::ReportWarning(LexicUnit * lu, unsigned long warningID)
{
#ifdef TRACE
	CompilerData->LogTrace->ReportEntry("ReportWarning");
#endif

#ifdef TRACE
	CompilerData->LogTrace->ReportLine("TODO");
#endif
	WarningEntry * we = NULL;
	for(int i = 0; i < this->predefinedWarnings->GetCount(); i++)
	{
		WarningEntry * weTest = this->predefinedWarnings->GetData(i);
		if(weTest->id == warningID)
		{
			we = weTest;
			break;
		}
	}
	printf("File %d [%d, %d]: warning 0x%X - %s\n", lu->sourceFileId, lu->sourceLineId, lu->sourceColumnId, warningID, we != NULL ? we->str : "?????");

#ifdef TRACE
	CompilerData->LogTrace->ReportExit("ReportWarning");
#endif
}




void ErrorReport::InitializeErrorsTable()
{
	this->predefinedErrors->Add(new ErrorEntry(ERR_GENERIC_ERROR, "Generic error has occured."));

	// LEXIC
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_UNKNOWN_CHAR_FOUND,				"Unrecognizable character found."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_MISSPELLED_OPERATOR_OR,			"First part of OR operator found, assuming the other part follows."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_MISSPELLED_OPERATOR_AND,			"First part of AND (&&) operator found, assuming the other part follows."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_UNRECOGNIZED_OPERATOR_SPECIAL,	"Neither operator nor special character recognized."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_UNFINISHED_COMMENT,				"Comment has no closing sequence (unfinished comment)."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_BAD_SUFFIX_NUMBER,				"Bad suffix on number found."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_UNEXPECTED_SYMBOL,				"Unexpected symbol found."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_NO_DIGIT_AFTER_DECIMAL_DOT,		"No digit found after decimal separator."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_WRONG_SYMBOL_AFTER_EXPONENT,		"Wrong symbol after exponent."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_NO_DIGIT_AFTER_EXPONENT_SIGN,	"No digit following sign in exponent."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_STRING_UNEXPECTED_END_OF_LINE,	"Unexpected end of line (EOL) found in string constant."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_STRING_UNEXPECTED_END_OF_FILE,	"Unexpected end of file (EOF) found in string constant."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_LEX_STRING_SOLO_BACKSLASH,			"Starting of escape sequence found (backslash), missing other part."));

	// SYNTAX
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROGRAM_BEGGINING, "Unknown identifier or constant for the beginning of the program."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CLASS_MODIFIERS_OR_CLASS, "No class modifiers or class beggining detected."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_KEYWORD_INTO_EXPECTED, "Keyword into was expected."));
    this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CLASS_BODY_ADD_BEGINING, "No unit from the select set of <class_body_add> was found at the begining."));
    this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CLASS_BODY_BEGINING, "No unit from the select set of <class_body> was found at the begining."));
    this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CLASS_BODY_MATCH, "Could not match the nonterminal symbol <class_body>"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_GPP_FILE_BEGINING, "No unit from the select set of <gpp_file> was found at the begining."));
    this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_USING_DIRECTIVES_BEGINING, "No unit from the select set of <using_directives> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_USING_DIRECTIVE_BEGINING, "No unit from the select set of <using_directive> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_FILE_BODY_BEGINING, "No unit from the select set of <file_body> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_MAIN_DEFINITION_BEGINING, "No unit from the select set of <main_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_DATA_TYPE_BEGINING, "No unit from the select set of <data_type> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ENUM_DEFINITION_BEGINING, "No unit from the select set of <enum_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ENUM_NAMES_BEGINING, "No unit from the select set of <enum_names> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ENUM_NAMES_ADD_BEGINING, "No unit from the select set of <enum_names_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TEMPLATE_DEFINITION_BEGINING, "No unit from the select set of <template_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TEMPLATE_USE_BEGINING, "No unit from the select set of <template_use> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TEMPLATES_LIST_BEGINING, "No unit from the select set of <templates_list> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TEMPLATES_LIST_ADD_BEGINING, "No unit from the select set of <templates_list_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CLASS_INHERIT_NAME_BEGINING, "No unit from the select set of <class_inherit_name> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_NAME_COMMA_ADD_BEGINING, "No unit from the select set of <name_comma_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_NAME_MATCH, "Could not match the terminal symbol 'NAME'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_END_OF_FILE_MATCH, "Could not match the terminal symbol 'endOfFile'."));
    this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SEMICOLON_MATCH, "Could not match the terminal symbol ';'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_AS_MATCH, "Could not match the terminal symbol 'as'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_LEFT_CURLY_BRACE_MATCH, "Could not match the terminal symbol '{'"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_RIGHT_CURLY_BRACE_MATCH, "Could not match the terminal symbol '}'"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_GREATER_THAN_MATCH, "Could not match the terminal symbol '>'"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CLASS_MATCH, "Could not match the terminal symbol 'class'"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CLASS_DEFINITION_BEGINING, "No unit from the select set of <class_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CLASS_MOD_BEGINING, "No unit from the select set of <class_mod> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CLASS_INHERIT_BEGINING, "No unit from the select set of <class_inherit> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_LEFT_PARENTHESIS_MATCH, "Could not match the terminal symbol '('."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_RIGHT_PARENTHESIS_MATCH, "Could not match the terminal symbol ')'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CONSTRUCTOR_DEFINITION_BEGINING, "No unit from the select set of <constructor_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CONSTR_MOD_BEGINING, "No unit from the select set of <constr_mod> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CONSTR_INHERIT_BEGINING, "No unit from the select set of <constr_inherit> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CONSTR_BODY_BEGINING, "No unit from the select set of <constr_body> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_FIELD_DEFINITION_BEGINING, "No unit from the select set of <field_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_FIELD_MODS_BEGINING, "No unit from the select set of <field_mods> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_FIELD_MOD_BEGINING, "No unit from the select set of <field_mod> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_FIELD_NAMES_BEGINING, "No unit from the select set of <field_names> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_FIELD_NAME_BEGINING, "No unit from the select set of <field_name> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_FIELD_NAMES_ADD_BEGINING, "No unit from the select set of <field_names_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_EQUALS_BEGINING, "No unit from the select set of <equals> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ARRAY_DEFINITIONS_BEGINING, "No unit from the select set of <array_definitions> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_RIGHT_SQUARE_BRACKET_MATCH, "Could not match the terminal symbol ']'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ARRAY_DEFINITION_BEGINING, "No unit from the select set of <array_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_GENERATE_BLOCK_BEGINING, "No unit from the select set of <generate_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_UPTO_EXPRESSION_BEGINING, "No unit from the select set of <upto_expression> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_AFTER_EXPRESSIO_BEGINING, "No unit from the select set of <after_expression> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_EVERY_EXPRESSION_BEGINING, "No unit from the select set of <every_expression> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PLUS_MINUS_EXPRESSION_BEGINING, "No unit from the select set of <plus_minus_expression> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TRANS_LIST_BEGINING, "No unit from the select set of <trans_list> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_COLON_MATCH, "Could not match the terminal symbol ':'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TRANS_LIST_ADDS_BEGINING, "No unit from the select set of <trans_list_adds> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TRANS_LIST_ADD_BEGINING, "No unit from the select set of <trans_list_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ADVANCE_BLOCK_BEGINING, "No unit from the select set of <advance_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ENTER_BLOCK_BEGINING, "No unit from the select set of <enter_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_FORMING_EXPRESSION_BEGINING, "No unit from the select set of <forming_expression> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_LEAVE_BLOCK_BEGINING, "No unit from the select set of <leave_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROPERTY_DEFINITION_BEGINING, "No unit from the select set of <property_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROPERTY_MODS_BEGINING, "No unit from the select set of <property_mods> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROPERTY_MOD_BEGINING, "No unit from the select set of <property_mod> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROPERTY_NAME_BEGINING, "No unit from the select set of <property_name> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROP_ARRAY_DEFS_BEGINING, "No unit from the select set of <prop_array_defs> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROP_ARRAY_DEF_BEGINING, "No unit from the select set of <prop_array_def> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_INT_MATCH, "Could not match the terminal symbol 'int'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROPERTY_BODY_BEGINING, "No unit from the select set of <property_body> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROPERTY_READ_BEGINING, "No unit from the select set of <property_read> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROPERTY_WRITE_BEGINING, "No unit from the select set of <property_write> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_NUMERIC_MATCH, "Could not match the terminal symbol 'numeric'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_METHOD_DEFINITION_BEGINING, "No unit from the select set of <method_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_METHOD_MODS_BEGINING, "No unit from the select set of <method_mods> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_METHOD_MOD_BEGINING, "No unit from the select set of <method_mod> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PROCESS_MATCH, "Could not match the terminal symbol 'process'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_START_PROCESS_BEGINING, "No unit from the select set of <start_process> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_METHOD_BODY_DECL_BEGINING, "No unit from the select set of <method_body_decl> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_METHOD_BODY_BEGINING, "No unit from the select set of <method_body> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_LABEL_METHOD_STATEMENT_BEGINING, "No unit from the select set of <label_method_statement> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_METHOD_STATEMENTS_BEGINING, "No unit from the select set of <method_statements> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_NAMESPACE_DEFINITION_BEGINING, "No unit from the select set of <namespace_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PARAMETERS_BEGINING, "No unit from the select set of <parameters> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PARAMETER_COMMA_ADD_BEGINING, "No unit from the select set of <parameter_comma_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PARAMETERS_ADD_BEGINING, "No unit from the select set of <parameters_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PARAMETER_BEGINING, "No unit from the select set of <parameter> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ARGUMENTS_BEGINING, "No unit from the select set of <arguments> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ARGUMENTS_ADD_BEGINING, "No unit from the select set of <arguments_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ARGUMENT_COMMA_ADD_BEGINING, "No unit from the select set of <argument_comma_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_VARIABLE_DEFINITION_BEGINING, "No unit from the select set of <variable_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PERIOD_MATCH, "Could not match the terminal symbol '.'"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_METHOD_CALL_BEGINING, "No unit from the select set of <method_call> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_IF_STATEMENT_BEGINING, "No unit from the select set of <if_statement> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_STATEMENT_ENDING_BEGINING, "No unit from the select set of <statement_ending> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ELSE_PART_BEGINING, "No unit from the select set of <else_part> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SWITCH_CASE_STATEMENT_BEGINING, "No unit from the select set of <switch_case_statement> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SWITCH_CASE_CASES_BEGINING, "No unit from the select set of <switch_case_cases> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SWITCH_CASE_CASE_BEGINING, "No unit from the select set of <switch_case_case> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SWITCH_CASE_BLOCK_BEGINING, "No unit from the select set of <switch_case_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SWITCH_CASE_DEFAULT_BEGINING, "No unit from the select set of <switch_case_default> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_WHILE_MATCH, "Could not match the terminal symbol 'while'"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_WHILE_STATEMENT_BEGINING, "No unit from the select set of <while_statement> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_DOWHILE_STATEMENT_BEGINING, "No unit from the select set of <dowhile_statement> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_FOR_STATEMENT_BEGINING, "No unit from the select set of <for_statement> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_BREAK_STATEMENT_BEGINING, "No unit from the select set of <break_statement> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CONTINUE_STATEMENT_BEGINING, "No unit from the select set of <continue_statement> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_GOTO_STATEMENT_BEGINING, "No unit from the select set of <goto_statement> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_START_ASSIGNMENTS_BEGINING, "No unit from the select set of <start_assignments> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_START_ASSIGNMENT_ADD_BEGINING, "No unit from the select set of <start_assignment_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_START_ASSIGNMENT_COMMA_ADD_BEGINING, "No unit from the select set of <start_assignment_comma_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ASSIGNMENT_MATCH, "Could not match the terminal symbol '='."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_START_ASSIGNMENT_BEGINING, "No unit from the select set of <start_assignment> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_STOP_STATEMENT_BEGINING, "No unit from the select set of <stop_statement> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ASSIGNMENT_DERIVATION_BEGINING, "No unit from the select set of <assignment_derivation> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_NUMERIC_MOD_BEGINING, "No unit from the select set of <numeric_mod> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ADDITION_MATCH, "Could not match the terminal symbol '+'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_INF_MATCH, "Could not match the terminal symbol 'INF'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_INF_END_BEGINING, "No unit from the select set of <inf_end> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_VALUE_PAIRS_BEGINING, "No unit from the select set of <value_pairs> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_LITERAL_MATCH, "Could not match the terminal symbol 'LITERAL'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ARROW_MATCH, "Could not match the terminal symbol '->'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_VALUE_PAIR_BEGINING, "No unit from the select set of <value_pair> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_VALUE_PAIR_ADD_BEGINING, "No unit from the select set of <value_pair_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SIGN_VALUE_BEGINING, "No unit from the select set of <sign_value> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_MODEL_MATCH, "Could not match the terminal symbol 'model'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_MODEL_DEFINITION_BEGINING, "No unit from the select set of <model_definition> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_MODEL_DEFINITION_IN_BEGINING, "No unit from the select set of <model_definition_in> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_MODEL_DEFINITION_OUT_BEGINING, "No unit from the select set of <model_definition_out> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_LABEL_LIST_BEGINING, "No unit from the select set of <label_list> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_LABELS_BEGINING, "No unit from the select set of <labels> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_COMMA_LABEL_BEGINING, "No unit from the select set of <comma_label> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_MODEL_MOD_BEGINING, "No unit from the select set of <model_mod> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_PERIOD_VARIABLE_VALUE_BEGINING, "No unit from the select set of <period_variable_value> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_VARIABLE_VALUE_ADD_BEGINING, "No unit from the select set of <variable_value_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_VARIABLE_VALUE_BEGINING, "No unit from the select set of <variable_value> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_VALUE_BEGINING, "No unit from the select set of <value> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_KEYWORD_OF_MATCH, "Could not match the terminal symbol 'of'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SEIZE_BLOCK_BEGINING, "No unit from the select set of <seize_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_RELEASE_BLOCK_BEGINING, "No unit from the select set of <release_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_INQUEUE_BLOCK_BEGINING, "No unit from the select set of <inqueue_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_OUTQUEUE_BLOCK_BEGINING, "No unit from the select set of <outqueue_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ARRIVE_BLOCK_BEGINING, "No unit from the select set of <arrive_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_DEPART_BLOCK_BEGINING, "No unit from the select set of <depart_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_MODEL_INSTANCE_BLOCK_BEGINING, "No unit from the select set of <model_instance_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_GOTO_BLOCK_BEGINING, "No unit from the select set of <goto_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_IF_BLOCK_BEGINING, "No unit from the select set of <if_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_WAIT_BLOCK_BEGINING, "No unit from the select set of <wait_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ON_SENSITIVITY_LIST_BEGINING, "No unit from the select set of <on_sensitivity_list> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_WHILE_UNTIL_BEGINING, "No unit from the select set of <while_until> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_THEN_STRUCTURE_BEGINING, "No unit from the select set of <then_structure> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ELSE_STRUCTURE_BEGINING, "No unit from the select set of <else_structure> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SENSITIVITY_LIST_BEGINING, "No unit from the select set of <sensitivity_list> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SENSITIVITY_LIST_ADDS_BEGINING, "No unit from the select set of <sensitivity_list_adds> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SENSITIVITY_LIST_ADD_BEGINING, "No unit from the select set of <sensitivity_list_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_GROUP_MATCH, "Could not match the terminal symbol 'group'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_JOIN_GROUP_BLOCK_BEGINING, "No unit from the select set of <join_group_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_LEAVE_GROUP_BLOCK_BEGINING, "No unit from the select set of <leave_group_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TO_MATCH, "Could not match the terminal symbol 'to'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SEND_TO_BEGINING, "No unit from the select set of <send_to> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_CREATE_BLOCK_BEGINING, "No unit from the select set of <create_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SPLIT_BLOCK_BEGINING, "No unit from the select set of <split_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_DESTROY_MATCH, "Could not match the terminal symbol 'destroy'."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_AND_DESTROY_BEGINING, "No unit from the select set of <and_destroy> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_EXECUTE_BLOCK_BEGINING, "No unit from the select set of <execute_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SIMULATION_BEGINING, "No unit from the select set of <simulation> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SIMULATION_BODY_BEGINING, "No unit from the select set of <simulation_body> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SIMULATION_STMT_BEGINING, "No unit from the select set of <simulation_stmt> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SIM_CONFIGURATION_BEGINING, "No unit from the select set of <sim_configuration> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_UNEXPECTED_END_OF_FILE, "Unexpected 'endOfFile' in do while loop."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SIM_CLEAR_BEGINING, "No unit from the select set of <sim_clear> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SIM_RESET_BEGINING, "No unit from the select set of <sim_reset> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_INITIALISATION_BEGINING, "No unit from the select set of <initialisation> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_INITIAL_VALUES_BEGINING, "No unit from the select set of <initial_values> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_INITIAL_VALUE_ADD_BEGINING, "No unit from the select set of <initial_value_add> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_INITIAL_VALUE_BEGINING, "No unit from the select set of <initial_value> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_INITIAL_VALUE_COMMA_BEGINING, "No unit from the select set of <initial_value_comma> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_GENERATE_TRANSACTIONS_BEGINING, "No unit from the select set of <generate_transactions> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TERMINATE_BLOCK_BEGINING, "No unit from the select set of <terminate_block> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_UNITS_MATCH, "Could not match the terminal symbol 'units'"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_IN_MATCH, "Could not match the terminal symbol 'in'"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_UNITS_IN_EXPRESSION_BEGINING, "No unit from the select set of <units_in_expression> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_UNITS_FROM_EXPRESSION_BEGINING, "No unit from the select set of <units_from_expression> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_FROM_MATCH, "Could not match the terminal symbol 'from'"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TIMEOUT_BEGINING, "No unit from the select set of <timeout> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_MODEL_BODY_BEGINNING, "No unit from the select set of <model_body> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_MODEL_DEFINE_BEGINNING, "No unit from the select set of <model_define> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_LABEL_GPSS_BLOCK_BEGINNING, "No unit from the select set of <label_gpss_block> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_MODEL_STRUCTURE_BEGINNING, "No unit from the select set of <model_structure> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_GPSS_BLOCK_BEGINNING, "No unit from the select set of <gpss_block> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_GATHER_BLOCK_BEGINING, "No unit from the select set of <gather_block> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SIMULATIONS_MATCH, "Could not match the terminal symbol 'simulations'"));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SIM_RUN_BEGINING, "No unit from the select set of <sim_run> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_LABEL_BEGINING, "Could not match method statement label."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_RETURN_STATEMENT_BEGINING, "No unit from the select set of <return_statement> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_START_STATEMENT_BEGINING, "No unit from the select set of <start_statement> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_INF_BEGIN_BEGINING, "No unit from the select set of <inf_begin> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_BLOCK_LABELS_BEGINING, "No unit from the select set of <block_labels> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_BLOCK_LABEL_BEGINING, "No unit from the select set of <block_label> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_VALUE_PAIRS_ADDS_BEGINING, "No unit from the select set of <value_pairs_adds> was found at the beginning."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_METHOD_STATEMENT_BEGINING, "No unit from the select set of <method_statment> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_ASSIGNMENT_BEGINING, "No unit from the select set of <assignment> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_SIMPLE_STATMENT_BEGINING, "No unit from the select set of <simple_statment> was found at the begining."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_METHOD_STATEMENT_PARSE, "Could not parse the nonterminal symbol <method_statement>."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SYN_NO_TRACE_PART_BEGINING, "No unit from the select set of <trace_part> was found at the begining."));

	// SEMANTIC
	this->predefinedErrors->Add(new ErrorEntry(ERR_SEM_MULTIPLE_ACCESS_MODIFIERS, "Multiple declaration of access modifiers."));
	this->predefinedErrors->Add(new ErrorEntry(ERR_SEM_ILLEGAL_MODIFIERS_COMBINATION, "Illegal combination of modifiers."));

	// other errors defintion...
}



void ErrorReport::InitializeWarningsTable()
{
	this->predefinedWarnings->Add(new WarningEntry(WAR_GENERIC_WARNING, "Generic warning."));

	// other warnings definition...
}


